package com.quanyan.common.exception;

import com.quanyan.common.enums.BaseEnum;

public class BizException extends RuntimeException {

    /**
     *
     */
    private static final long serialVersionUID = -2411085055825610813L;


    BaseEnum baseEnum;

    Object errorData;

    public BizException(RuntimeException e) {
        super(e);
    }

    public BizException(BaseEnum baseEnum, Object errorData) {
        this.baseEnum = baseEnum;
        this.errorData = errorData;
    }

    public BizException(BaseEnum baseEnum) {
        super(baseEnum.getLabel());
        this.baseEnum = baseEnum;
    }

    public BizException(String errMsg) {
        super(errMsg);
    }

    public BaseEnum getApiResponseEnum() {
        return baseEnum;
    }

    public Object getErrorData() {
        return errorData;
    }
}
